/*
 * @Autor: 张小鹏
 * @Date: 2020-04-16 19:59:30
 * @LastEditors: 张小鹏
 * @LastEditTime: 2020-04-22 13:53:20
 * @description:
 */
import Vue from 'vue'
import axios from 'axios'
import Cookies from 'js-cookie'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import fto from './components/index'
import '@/styles/index.scss' // global css

import App from './App'
import router from './router'
import store from './store'

import i18n from './lang' // Internationalization
import './icons' // icon
import './errorLog' // error log
import './permission' // permission control
import './mock' // simulation data

import * as filters from './filters' // global filters

Vue.use(Element, {
  size: Cookies.get('size') || 'medium' // set element-ui default size
  // i18n: (key, value) => i18n.t(key, value)
})

import VirtualTable from '@/components/ftotable/index'
import fasttable from '@/components/elementui/packages/table/src/table'
import tablecolumn from '@/components/elementui/packages/table/src/table-column'
import OrgSelect from '@/components/orgSelect/index'
import FtoScrollbar from '@/components/elementui/packages/scrollbar/src/main'
import FtoSelect from '@/components/elementui/packages/select/src/select'
import FtSelect from '@/components/elementui/packages/select/src/ftoselect'
import TreeSelect from '@/components/TreeSelect/index'

Vue.prototype.$axios = axios
Vue.component('OrgSelect', OrgSelect)
Vue.component('VirtualTable', VirtualTable)
Vue.component('fasttable', fasttable)
Vue.component('FtoScrollbar', FtoScrollbar)
Vue.component('tablecolumn', tablecolumn)
Vue.component('FtoSelect', FtoSelect)
Vue.component('FtSelect', FtSelect)
Vue.component('TreeSelect', TreeSelect)

Vue.use(fto)// 业务组件
// tablecolumn
// register global utility filters.
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: h => h(App)
})
